/**
 * 
 */
package com.mustafaiev.tair.cts.dao;

import java.util.List;

import com.mustafaiev.tair.cts.exeptions.DataNotRemovedException;
import com.mustafaiev.tair.cts.exeptions.DataNotStoredException;
import com.mustafaiev.tair.cts.model.Purchase;

/**
 * @author tair
 *
 */
public interface IPurchaseDAO extends ICostTrackingSystemDAO<Purchase> {


    /**
     * Saves passed purchases batch to database
     * 
     * @param purchases
     */
    void saveBatch(List<Purchase> purchases) throws DataNotStoredException;


    /**
     * Deletes passed purchases batch from database
     * 
     * @param purchases
     */
    void deleteBatch(List<Purchase> purchases) throws DataNotRemovedException;

    /**
     * Retrieves purchases from database
     * 
     * @return {@link List} of {@link Purchase}
     */
    List<Purchase> retrievePurchases();

    /**
     * Retrieves purchase from database by passed id
     * 
     * @param id
     * @return
     */
    Purchase retrievePurchase(Long id);

    /**
     * Retrieves list of purchases for basket
     * 
     * @param basketId
     * @return purchases list
     */
    List<Purchase> retrievePurchasesForBasket(Long basketId);

}
